import request from '../../utils/request';
import { OnionUtils } from '../../utils/onion-utils';

//限流规则列表查询
export const doFindRules = queryData => {
    return request({
        url: '/api/configic/flow/limit/listRules',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'queryData'},
        buildType : 'queryData',
        data: queryData
    });
};

//获取限流规则详细
export const doGetLimitRule = paramData => {
    return request({
        url: '/api/configic/flow/limit/getLimitRule',
        method: 'post',
        header:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: paramData
    });
}

//限流规则列表查询【分页】
export const doFindRulesByPage = queryData => {
    return request({
        url: '/api/configic/flow/limit/listPage',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'queryData'},
        buildType : 'queryData',
        data: queryData
    });
};

//保存限流规则
export const doSaveLimitRule = formData => {
    return request({
        url: '/api/configic/flow/limit/saveLimitRule',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: formData
    });
};

export const doDeleteLimitRule = paramData => {
    return request({
        url: '/api/configic/flow/limit/deleteLimitRule',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: paramData
    })
}